##
##
function(atom_to_literal_assignments f atom_assignments)
  map_import_properties(${f} atom_index_map atom_literal_identity_map atom_literal_negated_map)

  map_keys(${atom_assignments})
  ans(atoms)
  map_new()
  ans(result)
  foreach(atom ${atoms})
    map_tryget(${atom_index_map} ${atom})
    ans(ai)
    map_tryget(${atom_literal_identity_map} ${ai})
    ans(li)
    map_tryget(${atom_literal_negated_map} ${ai})
    ans(li_negated)
    map_tryget(${atom_assignments} ${atom})
    ans(value)
    eval_truth(NOT value)
    ans(value_negated)
    map_set(${result} ${li} ${value})
    map_set(${result} ${li_negated} ${value_negated})
  endforeach()
  return_ref(result)
endfunction()
